package com.mybills.proj;

import java.net.URL;
import java.util.Calendar;
import java.util.Vector;

import com.google.gdata.client.calendar.CalendarService;
import com.google.gdata.data.calendar.CalendarEntry;
import com.google.gdata.data.calendar.CalendarFeed;
import com.google.gdata.util.AuthenticationException;



import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.app.TimePickerDialog;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.DatePicker;
import android.widget.EditText;
import android.widget.TextView;
import android.widget.TimePicker;

public class reminder extends Activity{
	//String calID = "";
	//String pwd = "";
	//String ocal = "";
	@Override
	public void onCreate(Bundle savedInstanceState) {
		/*Bundle bundle=getIntent().getExtras();
    	calID=  bundle.getString("email");
        pwd = bundle.getString("pwD");
		Vector<String> v = new Vector<String>();
		CalendarService myService = new CalendarService("exampleCo-exampleApp-1");
		CalendarEntry calendar = new CalendarEntry();
		try {
			myService.setUserCredentials(cal,pwd);
			URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/owncalendars/full");
			CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);
			for (int i = 0; i < resultFeed.getEntries().size(); i++) {
				  CalendarEntry entry = resultFeed.getEntries().get(i);
				  v.addElement(entry.getTitle().getPlainText());
				  //System.out.println("\t" + v.elementAt(i));
				  }
			if(v.size()>1)
			{
				ocal = v.get(1);
				super.onCreate(savedInstanceState);
		        setContentView(R.layout.details);
			}
			if(v.size()==1) 
			{
				super.onCreate(savedInstanceState);
		        setContentView(R.layout.details);
			}
		} catch (Exception e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}*/
		//URL feedUrl = new URL("https://www.google.com/calendar/feeds/default/owncalendars/full");
		//CalendarFeed resultFeed = myService.getFeed(feedUrl, CalendarFeed.class);
        super.onCreate(savedInstanceState);
        setContentView(R.layout.details);
	}
	
	public void list(View v){
		EditText edittext = (EditText)findViewById(R.id.Bill_ID);
		EditText edittext1 = (EditText)findViewById(R.id.place);
		EditText edittext2 = (EditText)findViewById(R.id.Amount);
		EditText edittext3 = (EditText)findViewById(R.id.starttime);
		EditText edittext4 = (EditText)findViewById(R.id.endtime);
    	Intent it = new Intent();
    	it.putExtra("STARTTIME", edittext3.getText().toString() );
    	it.putExtra("ENDTIME", edittext4.getText().toString() );
    	it.putExtra("BILL_ID",edittext.getText().toString() );
    	it.putExtra("BILL_PLACE",edittext1.getText().toString() );
    	it.putExtra("BILL_AMOUNT",edittext2.getText().toString() );
    	Bundle bundle=getIntent().getExtras();
    	it.putExtra("emaiL", bundle.getString("email"));
        it.putExtra("pWd", bundle.getString("pwD"));
    	System.out.println("---------"+bundle.getString("email").toString()+"reminder");
    	it.setClass(this, details_list.class);
    	startActivity(it);
    	
    } 
	
} 
